/* 
 * File:   Thread.cpp
 * Author: ariel
 * 
 * Created on 4 de diciembre de 2009, 19:42
 */

#include "Thread.h"


void* run(void* params) {
    Runnable* runMethod=(Runnable*)params;
    runMethod->run();
    params=NULL;
    delete(runMethod);
}

void Thread::start() {
    pthread_create(&thread,NULL,run,(void*)runnable);
}
Thread::Thread(const Thread& orig) {
    this->runnable=orig.runnable;
    this->thread=orig.thread;
}

Thread::~Thread() {

}

